import React, { useRef } from 'react';
import { Button } from 'antd';
import Demo from './Demo';
import BaseModal from '../../../hooks/modal/v2/BaseModal';


export default function MyModalTestV2() {

  const deRef = useRef(null);
  const modalRef = useRef(null);
  const test = () => {
    // console.log(deRef.current); 
    deRef.current.sayHello('hello world');
  }

  const showModal = () => {
    modalRef.current.showModal();
  }

  return (
    <>
      <Button type='primary' onClick={showModal}>点我弹框--V2</Button>

      <BaseModal ref={modalRef}></BaseModal>

      {/* <Button onClick={test}>测试 useImperativeHandle</Button> */}
      {/* <Demo ref={deRef}></Demo> */}
    </>
  )
}
